package com.smallyu.order.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @Author: small-yu
 * @Package: com.smallyu.order.config
 * @Project: order
 * @Date: 2024/4/11
 * @Time: 2:50
 * 过滤器排除URI
 */
@Component
public class YuExcludeRequestURI {

    @Value("${smallyu.excludeUri}")
    private String requestURI;

    public List<String> excludeUri(){
        List<String> uriList = new ArrayList<>();
        if (!StringUtils.isEmpty(requestURI)){
            String[] splitUri = requestURI.split(",");
            uriList = Arrays.asList(splitUri);
        }
        return uriList;
    }
}
